package net.news.action;

import java.util.HashMap;
import java.util.List;

import javax.annotation.Resource;

import net.news.entity.News;
import net.news.entity.NewsType;
import net.news.service.NewsService;

import org.springframework.stereotype.Controller;

import com.livesky.framework.miniapp.ActionSupport;

/**
 * 项目名称：cmunews3084<br>
 * 类名称：HtmlNewsAction <br>
 * 类描述： 前台页面展示页面 <br>
 * 创建人：charles 创建时间：2011-5-18 下午02:28:20 <br>
 * 修改人： 修改时间： <br>
 * 修改备注：
 * 
 * @version V1.0
 */
@Controller
public class HtmlNewsAction extends ActionSupport {
	private List<News> newss;
	private List<News> newshot;
	private HashMap<String, Object> newsmap;
	private News news = new News();
	private Integer newstypeid;
	@Resource
	private NewsService newsService;

	/**
	 * 新闻首页显示方法
	 * 
	 * @return
	 */
	public String index() {
		newsmap = newsService.findNewsIndex();
		return SUCCESS;
	}

	/**
	 * 新闻详细页面
	 * 
	 * @return
	 */
	public String listcontent() {
		newss=newsService.newsHot();
		news = newsService.clickNewsInfo(news);
		return SUCCESS;
	}

	/**
	 * 根据新闻类型查询新闻id
	 * 
	 * @return
	 */
	public String list() {
		NewsType newsType = new NewsType();
		newsType.setId(newstypeid);
		news.setNewsType(newsType);
		newss = newsService.getNewsByNewsType(news);
		newshot=newsService.newsHot();
		return SUCCESS;
	}
	/**公司简介
	 * @return
	 */
	public String summary(){
		newshot=newsService.newsHot();
		return SUCCESS;
	}
	/**
	 * @return the newss
	 */
	public List<News> getNewss() {
		return newss;
	}

	/**
	 * @param newss
	 *            the newss to set
	 */
	public void setNewss(List<News> newss) {
		this.newss = newss;
	}

	/**
	 * @return the newsmap
	 */
	public HashMap<String, Object> getNewsmap() {
		return newsmap;
	}

	/**
	 * @param newsmap
	 *            the newsmap to set
	 */
	public void setNewsmap(HashMap<String, Object> newsmap) {
		this.newsmap = newsmap;
	}

	/**
	 * @return the news
	 */
	public News getNews() {
		return news;
	}

	/**
	 * @param news
	 *            the news to set
	 */
	public void setNews(News news) {
		this.news = news;
	}

	/**
	 * @return the newstypeid
	 */
	public Integer getNewstypeid() {
		return newstypeid;
	}

	/**
	 * @param newstypeid
	 *            the newstypeid to set
	 */
	public void setNewstypeid(Integer newstypeid) {
		this.newstypeid = newstypeid;
	}

	/**
	 * @return the newshot
	 */
	public List<News> getNewshot() {
		return newshot;
	}

	/**
	 * @param newshot the newshot to set
	 */
	public void setNewshot(List<News> newshot) {
		this.newshot = newshot;
	}

}
